//Sample of use of PageFactory
//Below code defines google home page object where are text field and submit button
//Be aware of use of @FindBy annotation
//http://code.google.com/p/selenium/wiki/PageFactory

package PageFactory;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class GoogleHomePage {
	
	@FindBy(xpath = "/html/body[@id='gsr']/div[@id='main']/span[@id='body']/center/div[@id='lga']/div[@id='hplogo']/div[11]")
	WebElement logo;

	@FindBy(name = "q") 
	WebElement searchBox;
	
	@FindBy(xpath = "/html/body[@id='gsr']/div[@id='main']/div[@id='footer']/div/div[@id='ftby']/div[@id='fll']")
	WebElement footer;
	
	public void searchFor (String text){
		//System.out.println("You reached search result page.");
		searchBox.sendKeys(text);
		searchBox.submit();
	}
	
}
